$(document).ready(function() {
	$("#getCode").click(function() {
		getCheckCode();
		timedCount();
	});
});
var c= 60;
var t;
function timedCount(){
    document.getElementById("getCode").innerHTML = c;
    c= c-1;
    if(c === 0){
        document.getElementById("getCode").innerHTML = "获取验证码";
        $("#getCode").bind("click");
        c = 60;
        return 0 ;
    }
    t= setTimeout("timedCount()",1000);
}
function getCheckCode() {
    var $ph_num =basedata.mid;
    var Post = "mid="+$ph_num;
    $.ajax({
        url:'../api/account/sendCode',
        type:'post',
        data:Post,
        success:function(msg){
            if(msg.code ==103){
                alert(msg.message);
            }
        }
    });
}
function changePassword() {
	var $code =$("#code").val();
	var $Password = $("#password").val();
	var Post ="mid="+basedata.mid+"&groupid="+basedata.groupid+"&token="+basedata.token+"&did="+commondata.myinfo+
	"&code="+$code+"&newpwd="+$Password;
	$.ajax({
		url:'../api/account/password',
		type:'post',
		data:Post,
		success:function(){
			
		}
	});
}